package com.codehub.service;

import com.codehub.entity.vo.PaginationResultVO;
import com.codehub.entity.po.SysRole;
import com.codehub.entity.query.RoleQuery;
import com.codehub.exception.BusinessException;

import java.util.List;

/**
 * 系统角色表Service
 */
public interface SysRoleService {

    /**
     * 根据条件查询列表
     */
    List<SysRole> findListByParam(RoleQuery query);

    /**
     * 根据条件查询数量
     */
    Integer findCountByParam(RoleQuery query);

    /**
     * 分页查询
     */
    PaginationResultVO<SysRole> findListByPage(RoleQuery query);

    /**
     * 新增
     */
    Integer add(SysRole bean);

    /**
     * 批量新增
     */
    Integer addBatch(List<SysRole> ListBean);

    /**
     * 批量新增或修改
     */
    Integer addOrUpdateBatch(List<SysRole> ListBean);

    /**
     * 根据RoleId查询
     */
    SysRole getRoleByRoleId(Integer roleId);

    /**
     * 根据RoleId更新
     */
    Integer updateRoleByRoleId(SysRole bean, Integer roleId);

    /**
     * 根据RoleId删除
     */
    Integer deleteRoleByRoleId(Integer roleId) throws BusinessException;

    void saveRole(SysRole sysRole, String menuIds, String halfMenuIds) throws BusinessException;

    void saveRoleMenu(Integer roleId, String menuIds, String halfMenuIds) throws BusinessException;

}